﻿using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System.Windows.Controls;
using XYAC.Framework.MonitorTireMaterialOnline.Extensions;
using XYAC.Framework.MonitorTireMaterialOnline.ViewModels;

namespace XYAC.Framework.MonitorTireMaterialOnline.Views
{
    /// <summary>
    /// QualityDataHistoryView.xaml 的交互逻辑
    /// </summary>
    public partial class QualityDataHistoryView : UserControl
    {
        public QualityDataHistoryView(IOptionsMonitor<AppConfig> options, ILogger<SystemConfigView> logger, QualityDataHistoryViewModel viewmodel)
        {
            try
            {
                InitializeComponent();
            }
            catch (Exception)
            {

            }
            this.AppConfig = options;
            this.DataContext = viewmodel;
            this.Logger = logger;
        }

        public IOptionsMonitor<AppConfig> AppConfig { get; }
        public ILogger Logger { get; }

        private void TabRecordHistory_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (this.DataContext is QualityDataHistoryViewModel viewmodel)
            {
                viewmodel.UserSelectDataType = this.TabRecordHistory.SelectedIndex;
            }
        }

        private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {

        }

        private void DataGrid_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
        {

        }
    }
}
